<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Pages extends CI_Controller {

        var $Array_Data;
        
        public function __construct() {
            parent::__construct();
            $this->Array_Data['UserInfo'] = $this->session->userdata('UserInfo'); 
        }
    
        public function login_form(){
            $this->load->view('user_group3/login');
        }
        
        public function signup_form(){
            $this->load->view('user_group3/signup');
        }
        
        public function us3_account_management_form(){
            $this->load->view('user_group3/account_management/account_management',$this->Array_Data);
        }
        
        public function us3_account_edit_contact_form(){
            $this->load->view('user_group3/account_management/edit_user_contact', $this->Array_Data);
        }
        
        public function us3_account_edit_qualification_form(){
            $this->load->view('user_group3/account_management/edit_user_qualification', $this->Array_Data);
        }
        
        public function us3_account_edit_workedplaces_form(){
            $this->load->view('user_group3/account_management/edit_user_workedplace', $this->Array_Data);
        }
        
        public function us3_account_edit_hobbies_form(){
            $this->load->view('user_group3/account_management/edit_user_hobbies', $this->Array_Data);
        }
        
        public function us3_account_edit_activities_form(){
            $CI =& get_instance();
            $CI->load->model('Users3_Activities_model','Us3Act');
            $this->Array_Data['Activities'] = $CI->Us3Act->Get(array('RelUserID' => $this->Array_Data['UserInfo']['UserGroup3ID']));
            $this->load->view('user_group3/account_management/edit_user_activities', $this->Array_Data);
        }
       
        public function us2_account_management_form(){
            $this->load->view('user_group2/account_management/account_management',$this->Array_Data);
        }
        public function us2_account_edit_contact_form(){
            $this->load->view('user_group2/account_management/edit_user_contact',$this->Array_Data);
        }
        
        public function footer_stats(){
            $User2 = $this->db->get(MYSQL_TABLE_PREFLIX.TABLE_USER2_ACCOUNTS_INFORMATION);
            $User3 = $this->db->get(MYSQL_TABLE_PREFLIX.TABLE_USER3_ACCOUNTS_INFORMATION);
            $Jobs = $this->db->get(MYSQL_TABLE_PREFLIX.TABLE_USER2_POSTS);
            $Data['NumUs2'] = $User2->num_rows;
            $Data['NumUs3'] = $User3->num_rows;
            $Data['NumJobs'] = $Jobs->num_rows;
            
            echo json_encode($Data);
        }
        
        
        public function header(){
            $UserInfo = $this->session->userdata('UserInfo');
            $Array_Data['UserInfo'] = $UserInfo;
            if($UserInfo['UserType'] == 'work'){ 
                $this->load->view('user_group2/header', $Array_Data);
            }else{
                $this->load->view('user_group3/header', $Array_Data);
            }
        }
}
